<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/> <spring:message code="message.listForm.weiShengJu"/> </title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
 	
   
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jiaoKuanDanGuanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/></a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                	<div class="textalign1"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    	<div class="boxinput">
	                    <input type="text" class="textinput" id="drugName" name="drugName" placeholder="<spring:message code="message.listForm.tongYongMing"/>" />
                    	</div>
                	<div class="textalign"><spring:message code="message.listForm.yaoPinBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                		<div class="boxinput">
	                    <input type="text" class="textinput" id="drugCode" name="drugCode" placeholder="<spring:message code="message.listForm.yaoPinBianMa"/>"  />
                    	</div>
                    <div class="textalign" >
                    <button type="button" class="btn btn-success btn-sm" onclick="gridSerch();" id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
                </div>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div style="margin-top: 10px;"></div>
        <div class=" box box-warning bottongroup">
            <a href="toSetPaynoticehs.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
        </div>
    </section>

		<%@ include file="/WEB-INF/component/commonJS.jsp"%>
		<script type="text/javascript">
		   //绑定回车
		   $('#drugName,#drugCode').bind('keydown', function(event) { 
		       if (event.keyCode == "13") {
		           $('#selectDicCompType').click();
		       }
		   });	
		   $("#drugName").focus();//加载页面光标在第一个查询框内
		 
		$(function () {
			jQuery("#gridlist").jqGrid({
    			url: "${ctx}/setPaynotice/getSetPaynoticehsDetailList.html",
    		    mtype: "POST",
    			datatype: "json",
    			postData: {
    				"noticeId" : "${noticeId}"
    			},
    			autowidth: true,
    			shrinkToFit: false,
    			height: 270,
    		   	colNames:[ '<spring:message code="message.jieSuan.daiJiaoKuanJinE"/>',
    		   	           '<spring:message code="message.jieSuan.daoHuoShiJian"/>',
    		   	           '<spring:message code="message.jieSuan.daoHuoShuLiang"/>',
    		   	           '<spring:message code="message.jieSuan.caiGouJia"/>',
    		   	           '<spring:message code="message.listForm.yaoPinBianMa"/>',
                           '<spring:message code="message.listForm.tongYongMing"/>',
                           '<spring:message code="message.listForm.jiXing"/>',
                           '<spring:message code="message.listForm.guiGe"/>',
                           '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
                           '<spring:message code="message.listForm.baoZhuangDanWei"/>',
                           '<spring:message code="message.listForm.caiZhi"/>',
                           '<spring:message code="message.listForm.shengChanQiYe"/>',
                           '<spring:message code="message.model.peiSongQiYe"/>',
    		   	           '<spring:message code="message.jieSuan.caiGouShiJian"/>',
    		   	           '<spring:message code="message.jieSuan.caiGouShuLiang"/>',
    		   	           '<spring:message code="message.jieSuan.jieShuoZhouQiStartTime"/>',
    		   	           '<spring:message code="message.jieSuan.jieShuoZhouQiEndTime"/>'
    		   	           ],
    		   	colModel:[
   				    { name: 'amount', width:97,align:"right" ,sortable:false,
                 	   formatter:function(cellvalue, options, row){
                           return formatAmount(cellvalue, options, row);
                       }
   				    },
    				{ name: 'recpDateTime', width:160,align:"center" ,sortable:false,
   				     formatter:function(cellvalue, options, row){
                         return new Date(cellvalue).format("yyyy-MM-dd hh:mm:ss");
                     }
   				    },
    				{ name: 'recpCount', width:79,align:"center" ,sortable:false},
    				{ name: 'proPrice', width:69,align:"right",sortable:false,
      		   		  formatter:function(cellvalue, options, row){
                            return formatAmount(cellvalue, options, row);
                        }
      		   		},
    				{ name: 'drugCode', width:120,align:"center" ,sortable:false,
    					 formatter:function(val, opts, row) {
    			  		     return "<a href=\"javascript:$.HN.dialog.opendialog('"+row.drugId+"','<spring:message code="message.lable.proddruginfoSTDdetail"/>','/medstgmini/stdDrug/drugInfoDetail.html?drugId="+row.drugId+"','800px','400px',operResult)\">"+val+"</a>"
    			  			}
    				},
    				
    				{ name: 'drugName', width:160,align:"left" ,sortable:false},
    				{ name: 'formName', width:79, align:"center",sortable:false},
    				{ name: 'specName', width:57, align:"center",sortable:false},
    				{ name: 'factor', width:90, align:"center",sortable:false},
    		   		{ name: 'unit', width:60, align:"center",sortable:false},
    		   		{ name: 'materialName', width:60, align:"center",sortable:false},
    		   		{ name: 'prodCompName', width:160,align:"left" ,sortable:false,
                        formatter:function(val, opts,row) {
                            return "<a href=\"javascript:$.HN.dialog.opendialog('"+row.prodCompId+"','"+val+"','/medstgmini/stdCompinfo/toStdCompinfoDetail.html?compId="+row.prodCompId+"','800px','400px',operResult)\">"+val+"</a>"
                       }
                   },
    		   	    { name: 'compName', width:160,align:"left" ,sortable:false},
    		   		{ name: 'proDateTime', width:160,align:"center",sortable:false,
    		   	     formatter:function(cellvalue, options, row){
    		   	    	return new Date(cellvalue).format("yyyy-MM-dd hh:mm:ss");
                     }
    		   	    },
    		   		{ name: 'proCount', width:80,align:"center",sortable:false},
    		   		{ name: 'settleSchBegTime', width:160,align:"center",sortable:false,
    		   		  formatter:function(cellvalue, options, row){
    		   			return new Date(cellvalue).format("yyyy-MM-dd hh:mm:ss");
                      }
    		   		},
    		   		{ name: 'settleSchEndTime', width:160,align:"center",sortable:false,
    		   		 formatter:function(cellvalue, options, row){
    		   			return new Date(cellvalue).format("yyyy-MM-dd hh:mm:ss");
                     }
    		   		}
    		   	   
    		   	],
    			 rowNum: 20,
    		     rowList: [10, 20, 50, 100],
    		     rownumbers: true,
    		     pager: "#gridpage",
    		     viewrecords: true,
    		     gridComplete: function(){
    	        	 //序号列宽度自适应（参数为jqgridID）
    	               autoRNWidth("gridlist");
    	           	//数据只有一条时默认选中（参数为jqgridID）
    	               selectByOneData("gridlist");
    			},
    		     caption: "<spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/><spring:message code="message.listForm.lieBiao"/>",
    		     jsonReader: {
    		         repeatitems: false,
    		         id: "ids"
    		     }
    		});
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $(window).trigger("resize");
            
        });
			
	
		//查询
        function gridSerch() {
        	var drugCode = $.trim($("#drugCode").val());
        	var drugName = $.trim($("#drugName").val());
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	             	"noticeId":"${noticeId}",
    	        		"drugCode":drugCode,
    	        		"drugName":drugName},
    	        		page:1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
  
        function operResult(val){
	    }

			 
</script>
</body>
</html>